<script type="text/javascript" language="javascript" src="{$smarty.const.THEME_RELATIVE}lytebox.js"></script>
{permissions level=$smarty.const.UILEVEL_PERMISSIONS}
{if $permissions.administrate == 1}
	<a href="{link action=userperms _common=1}"><img class="mngmnt_icon" style="border:none;" src="{$smarty.const.ICON_RELATIVE}userperms.png" title="{$_TR.alt_userperm}" alt="{$_TR.alt_userperm}" /></a>&nbsp;
	<a href="{link action=groupperms _common=1}"><img class="mngmnt_icon" style="border:none;" src="{$smarty.const.ICON_RELATIVE}groupperms.png" title="{$_TR.alt_groupperm}" alt="{$_TR.alt_groupperm}" /></a>
{/if}
{if $permissions.configure == 1}
	<a href="{link action=configure _common=1}"><img class="mngmnt_icon" style="border:none;" src="{$smarty.const.ICON_RELATIVE}configure.png" title="{$_TR.alt_configure}" alt="{$_TR.alt_configure}" /></a>
{/if}
{if $permissions.configure == 1 or $permissions.administrate == 1}
	<br />
{/if}
{/permissions}
<img src='{$smarty.const.THEME_RELATIVE}images/weblog_{$moduletitle}_{$smarty.const.LANG}.png' border=0>
{foreach from=$posts item=post}
	<div class="item {cycle values='odd,even'}">
		<div>
			<a href="popup.php?module=weblogmodule&view=Default&id={$post->id}&action=view" rel="lyteframe[group]" rev="width: 650px; height: 400px; scrolling: yes;"><h2 class="itemtitle weblog_itemtitle">{$post->title}{if $post->is_draft} <span class="draft">(Draft)</span>{/if}</h2></a>
			<div class="attribution">Bài viết được đăng ngày {$post->posted|format_date:$smarty.const.DISPLAY_DATE_FORMAT}</div>
			<br />
			{permissions level=$smarty.const.UILEVEL_PERMISSIONS}
			{if $permissions.administrate == 1 || $post->permissions.administrate == 1}
			<a href="{link action=userperms _common=1 int=$post->id}">
				<img class="mngmnt_icon" src="{$smarty.const.ICON_RELATIVE}userperms.png" title="{$_TR.alt_userperm_one}" alt="{$_TR.alt_userperm_one}" />
			</a>
			<a href="{link action=groupperms _common=1 int=$post->id}">
				<img class="mngmnt_icon" src="{$smarty.const.ICON_RELATIVE}groupperms.png" title="{$_TR.alt_groupperm_one}" alt="{$_TR.alt_groupperm_one}" />
			</a>
			{/if}
			{/permissions}
			{permissions level=$smarty.const.UILEVEL_NORMAL}
			{if $permissions.edit == 1 || $post->permissions.edit == 1}
			<a class="mngmntlink weblog_mngmntlink" href="popup.php?action=post_edit&module=weblogmodule&id={$post->id}&src={$__loc->src}">
			<img class="mngmnt_icon" src="{$smarty.const.ICON_RELATIVE}edit.png" title="{$_TR.alt_edit}" alt="{$_TR.alt_edit}" />
			</a>
			{/if}
			{if $permissions.delete == 1 || $post->permissions.delete == 1}
			<a class="mngmntlink weblog_mngmntlink" href="{link action=post_delete id=$post->id}" onclick="return confirm('{$_TR.delete_confirm}');">
			<img class="mngmnt_icon" src="{$smarty.const.ICON_RELATIVE}delete.png" title="{$_TR.alt_delete}" alt="{$_TR.alt_delete}" />
			</a>
			{/if}
			{/permissions}
		</div>
		<div class="bodycopy">
		<img src="{$smarty.const.THEME_RELATIVE}images/quote.gif" border=0 align=left>
		{$post->body}</div>
		<hr size="1" />
	</div>
{/foreach}
<!-- page split for weblog module -->
{if $page_count > 1 }
<div align=center style="padding-top: 30px;">
<font style="font-weight: bold; font-size: 12px; color: ">Trang&nbsp;&nbsp;</font>
{foreach from=$pages item=page key=page_key}
{if $page_key == $cur_page}
{$page}&nbsp;
{else}
<a href="{link action=view_page page=$page_key}">{$page}</a>&nbsp;
{/if}
{/foreach}
</div>
{/if}
{permissions level=$smarty.const.UILEVEL_NORMAL}
{if $permissions.post == 1}
<br />
<a class="mngmntlink weblog_mngmntlink" href="popup.php?module=weblogmodule&action=post_edit&src={$loc->src}">{$_TR.new_post}</a>
{/if}
{/permissions}
